package com.wsj.service.impl;

import java.util.List;

import com.wsj.dao.ITopTitleDao;
import com.wsj.service.ITopTitleServ;
import com.wsj.util.exception.BusinessException;
import com.wsj.web.vo.homeSite.Toptitle;

public class TopTitleServImpl implements ITopTitleServ {

	private ITopTitleDao topTitleDao; 
	
	public void delete(Integer id) throws BusinessException {
		if(id != null && !(new Integer(0).equals(id))){
			this.topTitleDao.delete(id);
		}
	}

	public List<Toptitle> getAllList() throws BusinessException {
		return this.topTitleDao.getAllList();
	}

	@SuppressWarnings("unused")
	public List<Toptitle> getTopList(Integer top) throws BusinessException {
		List list = null;
		if(top != null  && top.intValue() > (new Integer(0))){
			return this.topTitleDao.getTopList(top);
		}
		
		return null;
	}

	public Toptitle loadById(Integer id) throws BusinessException {
		Toptitle t = null;
		if(id != null && !(new Integer(0).equals(id))){
			t = this.topTitleDao.loadById(id);
		}
		return t;
	}

	public void saveOrUpdate(Toptitle topTitle) throws BusinessException {
		if(topTitle != null){
			this.topTitleDao.saveOrUpdate(topTitle);
		}
	}


	public ITopTitleDao getTopTitleDao() {
		return topTitleDao;
	}

	public void setTopTitleDao(ITopTitleDao topTitleDao) {
		this.topTitleDao = topTitleDao;
	}

	
}
